<template>
  <div class="scroll-wrapper" ref="wrapper">
      <div class="scroll-content">
          <!-- 景点搜索结果 -->
          <div v-if="data.viewDatas && data.viewDatas.length > 0">
              <home-title title="景点搜索结果："></home-title>
              <view-list :viewDatas="data.viewDatas"></view-list>
          </div>
          <!-- 美食搜索结果 -->
          <div v-if="data.foodDatas && data.foodDatas.length > 0">
              <home-title title="美食搜索结果："></home-title>
              <view-list :viewDatas="data.foodDatas"></view-list>
          </div>
          <!-- 酒店搜索结果 -->
          <div v-if="data.hotelDatas && data.hotelDatas.length > 0">
              <home-title title="酒店搜索结果："></home-title>
              <view-list :hotelDatas="data.hotelDatas"></view-list>
          </div>
          <!-- 按摩搜索结果 -->
          <div v-if="data.massageDatas && data.massageDatas.length > 0">
              <home-title title="按摩搜索结果："></home-title>
              <view-list :massageDatas="data.massageDatas"></view-list>
          </div>
          <!-- KTV搜索结果 -->
          <div v-if="data.ktvDatas && data.ktvDatas.length > 0">
              <home-title title="KTV搜索结果："></home-title>
              <view-list :ktvDatas="data.ktvDatas"></view-list>
          </div>
      </div>
  </div>
</template>

<script>
import BetterScroll from 'better-scroll';

import ViewList from './ViewList/Index';
import FoodList from './FoodList/Index';
import HotelList from './HotelList/Index';
import MassageList from './MassageList/Index';
import KtvList from './KtvList/Index';
import HomeTitle from './Sub/HomeTitle';

export default {
  name: 'SearchScrollWrapper',
  components: {
      ViewList,
      FoodList,
      HotelList,
      MassageList,
      KtvList,
      HomeTitle
  },
  props: {
      data: Object
  },
  updated () {
      console.log(this.data)
      this.scroll = new BetterScroll(this.$refs.wrapper)
  }
}
</script>

<style lang="scss" scoped>

</style>